The creation of digital images by compositing multiple component images is well known. Although early compositing techniques manipulated only opaque component images, over recent years the use of compositing techniques relying upon alpha channel opacity values has become increasingly popular. An introduction to compositing techniques is found in the article “Compositing Digital Images” Porter, T.; Duff, T.; SIGGRAPH 1984 pages 253-259 (hereinafter referred to as Porter & Duff).
Although the component images may be stored in compressed form it is generally necessary, using traditional compositing techniques, to convert these compressed component images to uncompressed pixel data prior to performing compositing operations. This can result in having to composite large numbers of pixels on a pixel-by-pixel basis. The compositing together of large pixel-based images requires large amounts of computer memory, this requirement increasing at approximately the square of the image resolution. In addition to the computer memory requirements, the compositing together on a pixel-by-pixel basis of large images may also require large amounts of computational resources.
Component images can be stored in compressed form using run-length encoding, or some other run-based technique. In such circumstances, the component images may be described by an ordered sequence of runs, each run having a pixel value (or colour) and a number of consecutive pixels with that pixel value. An example of prior art compositing of two such components is shown in the system 200 of FIG. 2 where a first component 202 includes a pixel value P1 and a number N1, the number N1 being the number of consecutive pixel locations at which the colour P1 is reproduced in the component image 202. Another component 204 is likewise described. In order to perform compositing, each component 202 and 204 is decompressed (decoded) to provide corresponding pixel data runs 206 and 208 respectively which are then used as inputs to a compositing operation 210. The compositing operation 210 outputs a composited pixel run 212 which can then be encoded to provide an output component 214 of corresponding form to the input components 202 and 204. The deficiencies discussed above apply to the system 200.
The creation of digital images from multiple component images can often be represented by an expression tree, or similar hierarchical structure, which describes the structure of the image creation utilising a series of operators. In cases where the image is created and then later edited and recreated, it can be advantageous to cache the results of the composition at every operator node of the tree, since then only the modified parts of the tree will then need to be recomposited. This reduces the number of computations required for the recreation of the image. As the cached data is typically in the form of pixels, the caching of this data may required large amounts of computer memory. Hence there is advantage in using an image compression scheme provided that such compressed images can be composited without additional computational overhead.
Computer generated images often have large areas of uniform colour and opacity. Compositing two such images often involves applying identical pixel with pixel compositing operations over and over again. The need to decode inputs and encode composited results further exacerbates problems of memory utilisation and processing speed.
The article “Merging and Transformation of Raster Images for Cartoon Animation”, Wallace, B. A.; SIGGRAPH 1981 Proc., pages 253-262 discloses and discusses the benefits of the compositing of run-length encoded images without a need to decode the runs. European Patent Publication No. EP 0 855 680 A1 describes variations of a particular arrangement for this process. However, of the various configurations described, which in some way purport to account for transparency in at least one component input image, none provide for the implementation of compositing operations involving transparency components in a fashion corresponding to that of pixel-by-pixel alpha-channel compositing. For example, EP 0 855 680 A1 describes applying a weighting factor to, or averaging, pixels values in runs from two encoded images in order to obtain an encoded composite result from encoded input data. Whilst such may be useful for wholly opaque images, or runs having constant colour, such does not provide for the full gamut of compositing operations including those described by Porter & Duff, or for where the input components are non-uniform. Simply speaking, EP 0 855 680 A1 treats transparency as an additional colour, rather than as an additional colour channel (an alpha channel). Wallace disclosed a general opacity channel in images but only described a MERGE operator, equivalent to the Porter & Duff OVER operator.
Advanced graphics systems can describe run-based input components in a variety of forms, such as colour blends, or simply as uncompressed pixels. For example, where a pixel image is to be composited with a graphic object image using a particular operation, each scan line of the pixel image may be still be described as a single run as opposed to a series of runs, many perhaps one pixel long, of different colour values.
It is desirable therefore to provide an enhanced arrangement having a capacity to receive a wide variety of run-based input data types and be able to perform a wide variety of traditional compositing operations.